<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>边框如何实现三角形</title>
    <style>
        .triangle {
            width: 0;
            height: 0;
            border-top: 20px solid pink;
            border-bottom: 20px solid purple;
            border-right: 20px solid blue;
            border-left: 20px solid yellow;
            margin-bottom: 20px;
        }
        .one {
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 20px ;
            border-color: red transparent transparent transparent;
            line-height: 0;
            font-size: 0;
        }
    </style>
</head>
<body>
<div class="triangle">
</div>
<div class="one">

</div>
</body>
</html>